﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AttributeEntry.aspx.cs" Inherits="com.vs.RF.Web.receiving.AttributeEntry" MasterPageFile="~/RF.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="body" runat="server">

    <script type="text/javascript">
        function valForm() {
            var regEx;
            var bError = true;
            <% for (int i=0; i<this.iAttrNum; i++){ %>
            regEx = new RegExp("<%= this.ltTemp[i].PATTERN %>");
            if (!regEx.test(form1.tbAttr<%=i %>.value)){
                P<%=i %>.innerHTML = "格式不符";
                bError = false;
            }
            <% } %>
            
            return bError;
        }
        
        var iNumOfSubmit = 0;
        
        function btnOK_Click(){
            if (iNumOfSubmit > 0)
                return;
            if (valForm()){
                iNumOfSubmit++;
                form1.submit();
            }
        }
        
        function btnCancel_Click(){
            form1.action = "CheckInQtyEntry.aspx";
            form1.submit();
        }
        
        function on_Load(){
            form1.tbAttr0.focus();
        }
    </script>
    
    
    <%= stErrorMessage %>
    <form id="form1" action="AttributeEntryHandling.aspx" method="post">
    <div>
        <table>
            <% for (int i = 0; i < iAttrNum; i++){ %>
            <tr>
                <td><%= this.ltTemp[i].DESCRIPTION %>：</td>
                <td>
                    <input type="text" name="tbAttr<%=i %>" /><span id="P<%=i %>"/>
                </td>
            </tr>            
            <% } %>
        </table>
    </div>    
    <div id="footer">  
        <input type="button" id="btnOK" value="确定" onclick="btnOK_Click()" class="greyRed"/>
        <input type="button" id="btnCancel" value="取消" onclick="btnCancel_Click()" class="greyRed" />
    </div>
    </form>
</asp:Content>